from likeshop_api_project.api.login_api import login_model
from likeshop_api_project.base.myBase import Tools


class prepay_model(Tools):
    path = '/api/payment/prepay'

    def prepay_action(self, afrom, order_id, order_source, hd):
        mydata = {
            "from":afrom,
            "order_id":order_id,
            "order_source":order_source
        }
        print(self.hosturl + self.path)
        prepay = self.huihua.post(url=self.hosturl + self.path, data=mydata, headers=hd)
        return prepay.json()


# import requests
#
# s = requests.session()
# login = login_model(huihua=s)
# msg = login.login_action(account='17612345678', pwd='admin123', client='4')
# print(msg)
# tokena = msg['data']['token']
# hd = {
#     'token': tokena
# }
# print(hd)
# prepay = prepay_model(huihua=s)
# msg2 = prepay.prepay_action(afrom="order", order_id=367, order_source=6, hd=hd)
# print(msg2)
